package com.model;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.net.InetAddress;
import java.util.List;

@Data
@ConfigurationProperties(prefix = "smx")
@Component
@Validated
public class ValidateProperties {
    private boolean enabled;

    @NotNull
    private InetAddress remoteAddress;

    @Valid
    private Security security;

    @Data
    public static class Security {

        private String username;

        @NotNull
        private String password;

        private List<String> roles;

    }
}
